package com.xilihui.xlh.business.requests;

import android.content.Context;

import com.xilihui.xlh.business.entities.DownloadMsg;
import com.xilihui.xlh.business.entities.HomeEntity;
import com.xilihui.xlh.business.entities.MsgEntivity;
import com.xilihui.xlh.business.entities.ShopDetailEntity;
import com.xilihui.xlh.constant.StrConst;
import com.xilihui.xlh.core.http.HttpManager;
import com.xilihui.xlh.core.util.SPUtil;

import rx.Observable;

/**
 * Created by Administrator on 2018/6/1.
 */

public class HomeRequest {
    
    public static HomeService homeService = HttpManager.getRetrofit().create(HomeService.class);


    /**
     * 首页
     * @param lat
     * @param lng
     * @param page
     * @return
     */
    public static Observable<HomeEntity> getHome(Context context,String lat, String lng, int page){
        String access_token = (String) SPUtil.get(context,SPUtil.TOKEN,"");
        return homeService.getHome(access_token,lat,lng,page);
    }

    /**
     * 首页门店-门店详情
     * @param agent_id
     * @param page
     * @return
     */
    public static Observable<ShopDetailEntity> shopDetail(Context context,int agent_id,int page){
        String access_token = (String)SPUtil.get(context,SPUtil.TOKEN,"");
        return homeService.detail(access_token,agent_id,page);
    }

    /**
     * 消息
     * @param context
     * @param page
     * @return
     */
    public static Observable<MsgEntivity> msg(Context context,int page){
        String access_token = (String)SPUtil.get(context,SPUtil.TOKEN,"");
        return homeService.msg(access_token,page);
    }
    
}
